home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / ICProgKit 1.3.sit / ICProgKit1.3 / Goodies / ICRandomSignature / QuickDrawRules.p < prev    next >
Text File  |  1995-02-12  |  948b  |  44 lines

  1. unit QuickDrawRules;
  2.  
  3. interface
  4.  
  5.     type
  6.         qdRecord = record
  7.                 randSeed: longint;
  8.                 screenBits: BitMap;
  9.                 arrow: Cursor;
  10.                 case integer of
  11.                     0: (
  12.                             dkGrey: Pattern;
  13.                             ltGrey: Pattern;
  14.                             grey: Pattern;
  15.                             black: Pattern;
  16.                             white: Pattern;
  17.                             thePort: GrafPtr;
  18.                     );
  19.                     1: (
  20.                             dkGray: Pattern;
  21.                             ltGray: Pattern;
  22.                             gray: Pattern;
  23.                     );
  24.             end;
  25.         qdRecordPtr = ^qdRecord;
  26.  
  27.     function QDGlobals: qdRecordPtr;
  28.     inline
  29.         $2015,                         { move.l     (a5),d0                 ; get thePort                                         }
  30.         $0480, $0000, $007E,     { subi.l     #$0000007E, d0     ; #$7E = (sizeof(qdRecord) - sizeof(thePort)) }
  31.         $2E80;                         { move.l     d0,(sp)                ; set result                                            }
  32.  
  33. implementation
  34.  
  35. end. { QuickDrawRules }
  36.  
  37. { Pascal for the above inline stuff }
  38.  
  39. function QDGlobals: qdRecordPtr;
  40.     type
  41.         longPtr = ^longint;
  42. begin
  43.     QDGlobals := qdRecordPtr(longPtr(SetCurrentA5)^ - (sizeof(qdRecord) - sizeof(thePort)));
  44. end; { QDGlobals }